#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	string t;
	cin >> t;
	int cnt = t[1] - '0';
	//cout << cnt << endl;
	int a = 1184, b = 841;
	for (int i = 1; i <= cnt; i++)
	{
		a >>= 1;
		swap(a, b);
	}
	cout << a << endl << b;
	return 0;
}